package com.zq.behavior.visitor;

public class Client {
    public static void main(String[] args) {
        ObjectStructure structure = new ObjectStructure();
        ConcreteElementA elementA = new ConcreteElementA();
        ConcreteElementB elementB = new ConcreteElementB();
        structure.register(elementA);
        structure.register(elementB);

        Visitor visitor = new ConcreteVisitor();

        structure.accept(visitor);

        structure.unregister(elementA);

        structure.accept(visitor);
    }
}
